<template>
	<view>
		<view class="pB15 mL15 mR15 bgf pL15 pR15 pT15 pB10 radius30">
			<view class="font14 bold t-center">
				{{info.titile}}
			</view>
			<view class="t-right font12 u-6 mB10 mT10">
				{{info.createTime}}
			</view>
			<view class="line32">
				{{info.messageContent}}
			</view>
		</view>

	</view>
</template>

<script>
	import {
		toTimeText
	} from "@/utils/common/date.js"
	import {
		sysRead
	} from "@/api/common.js"
	export default {

		data() {
			return {
				info: {}

			};
		},
		onLoad(e) {
			const pages = getCurrentPages();
			const prevPage = pages[pages.length - 2];
			// 从上个页面实例中获取传递的数据
			const data = prevPage.dataToPass;
			if (data) {
				this.info=data
				if(data.messageState!=1){
					this.setRead(data.id)
				}
			}
		},
		methods: {
			toText(val) {
				return toTimeText(val)
			},
			setRead(id){
				sysRead({id:id})
			}
		}
	};
</script>

<style lang="scss">
	page {
		/* #ifdef MP-USER */
		background: linear-gradient(0deg, #F8FAFF, #E1EEFF);
		/* #endif */
		/* #ifdef MP-COMPANY */
		background: linear-gradient(0deg, #F8FAFF, #EBF0FF);
		/* #endif */
		/* #ifdef MP-ECONOMIC */
		background: linear-gradient(0deg, #F8FAFF, #EBFCFF);
		/* #endif */
	}
</style>
<style scoped lang="scss">
	.messageItem {
		background-color: #ffffff;
		padding: 20rpx;
		border-radius: 10rpx;
		font-size: 24rpx;
		line-height: 48rpx;

	}
</style>